#ifndef VIDEOSTRUCTS_H
#define VIDEOSTRUCTS_H

#include <QByteArray>
#include <cstdint>

// 视频元数据结构
struct VideoMetadata {
    int cameraId;
    int codecId;
    int width;
    int height;
    int timeBaseNum;
    int timeBaseDen;
    QByteArray spsPps; // SPS/PPS数据
};

// 视频帧结构
struct VideoFrame {
    int cameraId;
    uint32_t size;
    int64_t pts;
    int64_t dts;
    QByteArray data;
};

// 序列化和反序列化函数
QByteArray serializeMetadata(const VideoMetadata& metadata);
VideoMetadata deserializeMetadata(const QByteArray& data);

QByteArray serializeVideoFrame(const VideoFrame& frame);
VideoFrame deserializeVideoFrame(const QByteArray& data);

#endif // VIDEOSTRUCTS_H
